const port =
  process.env.port || process.env.npm_config_port || 8080 || 8081 || 8082 // dev port

// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
  publicPath: '/', // 本地开发+打包用
  // publicPath: '/admin', // nginx打包用
  // publicPath: process.env.BASE_URL, // 本地开发用
  outputDir: 'dist',
  assetsDir: 'static',
  // lintOnSave: process.env.NODE_ENV === 'development' ? false : true,
  lintOnSave: false,
  productionSourceMap: false,
  devServer: {
    port: port,
    open: false,
    overlay: {
      warnings: false,
      errors: true,
    },
    // before: require('./mock/mock-server.js')
    proxy: {
      // change xxx-api/login => mock/login
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      '/test': {
        // target: 'http://192.168.249.192:18004', // 习武杰
        // target: 'http://192.168.43.42:18004', // 阮建港
        // target: 'http://172.20.10.2:18004', // 阮建港
        // target: 'http://192.168.216.33:18004', // 阮建港
        // target: 'http://192.168.47.192:18004', // 习武杰1
        // target: 'http://192.168.238.164:18004/', // 习武杰2 他的热点
        // target: 'http://127.0.0.1:18004', // 本地
        target: 'http://localhost:18004',
        ws: false,
        //secure:false,
        changeOrigin: true,
        pathRewrite: {
          '^/test': '',
        },
      },
    },
  },

  // lintOnSave: false, // 保存的时候不eslint检查
}
